//app.js
App({
  onLaunch: function () {
    // 获取状态栏和标题栏高度
    const systemInfo = wx.getSystemInfoSync();
    const statusBarHeight = systemInfo.statusBarHeight * (750 / systemInfo.windowWidth);
    const titleBarHeight = 44 * (750 / systemInfo.windowWidth);
    this.globalData.statusBarHeight = statusBarHeight;
    this.globalData.titleBarHeight = titleBarHeight;
  },

  // 全局属性
  globalData: {
    // 状态栏高度
    statusBarHeight: 0,
    // 标题栏高度
    titleBarHeight: 0
  }
})